#define _CRT_SECURE_NO_WARNINGS 1
#include <string>
using namespace std;
class Solution {
public:
    string solve(string s, string t)
    {
        string ret;
        int m = s.size(), n = t.size();
        int i = m - 1, j = n - 1;
        int carry = 0;
        while (i >= 0 && j >= 0)
        {
            int res = ((s[i] - '0') + (t[j] - '0') + carry);
            ret.push_back((res % 10) + '0');
            carry = res / 10;
            --i;
            --j;
        }
        while (i >= 0)
        {
            int res = ((s[i] - '0') + carry);
            ret.push_back((res % 10) + '0');
            carry = res / 10;
            --i;
        }
        while (j >= 0)
        {
            int res = ((t[j] - '0') + carry);
            ret.push_back((res % 10) + '0');
            carry = res / 10;
            --j;
        }
        if (carry != 0)
        {
            ret.push_back(carry + '0');
        }
        reverse(ret.begin(), ret.end());
        return ret;
    }
};